package com.fone.player.activity;

import com.fone.player.ApplicationManage;
import com.fone.player.client.Callback;
import com.fone.player.client.Error;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.widget.Toast;

public class BaseFragment extends Fragment {
	private Context context = ApplicationManage.getAplicationManageInstance();
	/**
	 * 标志该Fragment是否销毁了
	 */
	protected boolean destory = false;

	/**
	 * Toast短显示
	 * 
	 * @param int pResId
	 */
	protected void showShortToast(int pResId) {
		showShortToast(context.getString(pResId));
	}

	/**
	 * Toast短显示
	 * 
	 * @param String
	 *            pMsg
	 */
	protected void showShortToast(String pMsg) {
		Toast.makeText(context, pMsg, Toast.LENGTH_SHORT).show();
	}

	/**
	 * Toast长显示
	 * 
	 * @param int pResId
	 */
	protected void showLongToast(int pResId) {
		showLongToast(context.getString(pResId));
	}

	/**
	 * Toast长显示
	 * 
	 * @param String
	 *            pMsg
	 */
	protected void showLongToast(String pMsg) {
		Toast.makeText(context, pMsg, Toast.LENGTH_LONG).show();
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		destory = true;
	}
	
}
